<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //求圆的面积
        function getArea(r) {
       // pi  Math.PI pi:圆的周长和它的直径之比近似π≈3.141592653589793
       // Math.pow()  //求平方
       r = r || 0;
       return Math.PI * Math.pow(r, 2);
   }
    var area = getArea(5);
    console.log("半径为5的圆的面积是："+area);
//求圆的周长
function getLong (r) {
         r = r || 0;
         return 2 * Math.PI * r;
     }
     var long = getLong(5);
     console.log("半径为5的圆的周长是："+long);   
    </script>
</body>
</html>